{%- set governor = salt['pillar.get']('default:OMV_CPUPOWER_GOVERNOR', salt['grains.filter_by']({
    "default": "ondemand",
    "amd64": "conservative",
    "i386": "conservative",
    "armhf": "schedutil",
    "arm64": "schedutil",
    "armel": "schedutil"
  }, grain="osarch")) -%}
{%- set min_freq = salt['pillar.get']('default:OMV_CPUPOWER_MINFREQ', '') -%}
{%- set max_freq = salt['pillar.get']('default:OMV_CPUPOWER_MAXFREQ', '') -%}
{%- set freq = salt['pillar.get']('default:OMV_CPUPOWER_FREQ', '') -%}
{%- set perf_bias = salt['pillar.get']('default:OMV_CPUPOWER_PERFBIAS', '') -%}
{{ pillar['headers']['multiline'] }}
# Configuration file for cpupower.service systemd service unit

# --- CPU clock frequency ---

# Define CPU governor
# Valid governors: ondemand, performance, powersave, conservative, userspace
GOVERNOR='{{ governor }}'

# Limit frequency range
# Valid suffixes: Hz, kHz (default), MHz, GHz, THz
{%- if min_freq | length > 0 %}
MIN_FREQ="{{ min_freq }}"
{%- else %}
#MIN_FREQ="2.25GHz"
{%- endif %}
{%- if max_freq | length > 0 %}
MAX_FREQ="{{ max_freq }}"
{%- else %}
#MAX_FREQ="2.25GHz"
{%- endif %}

# Set a specific frequency
# Requires userspace governor to be available.
# If this option is set, all the previous frequency options are ignored
{%- if freq | length > 0 %}
FREQ="{{ freq }}"
{%- else %}
#FREQ=
{%- endif %}

# --- CPU policy ---

# Set a register on supported Intel processore which allows software to convey
# its policy for the relative importance of performance versus energy savings to
# the processor. See man CPUPOWER-SET(1) for additional details
{%- if perf_bias | length > 0 %}
PERF_BIAS="{{ perf_bias }}"
{%- else %}
#PERF_BIAS=
{%- endif %}
